<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        class Animal{
            // 构造方法
            constructor(name,age){
                this.name=name;
                this.age=age;
            }
            h1(){
                console.log('姓名',this.name);
                console.log('年龄',this.age);
            }

            //静态方法和属性
        }

        var tom=new Animal('汤姆',19);
        tom.h1();
    </script>
</body>
</html>